<?php
// +----------------------------------------------------------------------
// | ThinkCMF [ WE CAN DO IT MORE SIMPLE ]
// +----------------------------------------------------------------------
// | Copyright (c) 2013-2019 http://www.thinkcmf.com All rights reserved.
// +----------------------------------------------------------------------
// | Licensed ( http://www.apache.org/licenses/LICENSE-2.0 )
// +----------------------------------------------------------------------
// | Author: 老猫 <thinkcmf@126.com>
// +----------------------------------------------------------------------
namespace app\admin\model;

use app\models\BaseModel;
use think\Exception;
use think\Model;

class EmployeeModel extends BaseModel
{

    protected $type = [
        'more' => 'array',
    ];

    public function demo()
    {
        
    }

    /**
     * @param $role_id
     * @return array|\PDOStatement|string|\think\Collection|\think\model\Collection
     */
    public static function getListByRole($role_id)
    {
        try {
            return self::alias('e')
                ->leftJoin('sh_role_user r','e.user_id=r.user_id')
                ->where('r.role_id',$role_id)
                ->field('e.id,e.name')
                ->select();
        }catch (\Exception $exception){
            self::setErrorInfo($exception->getMessage());
        }
    }

}